package com.iris.live.services.common.reconsitution;

/**
 * yitianle
 * 异常帮助
 * 2017/02/17.
 */
public class HttpStatusEnum {

    public static final int SUCCESS = 0;
    public static final int ERROR = 500;

    public static final int VALI_IS_WRONG = 101;
    public static final int INVLID_PARAMTERS = 102;
    public static final int Authentication_Failure = 103;
    public static final int TOKEN_EXPIRED = 104;
    public static final int USER_NOT_FOUND = 105;
    public static final int PASSWORD_IS_WRONG = 106;
    public static final int USERNAME_IS_LIVED = 107;
    public static final int NICKNAME_IS_LIVED = 108;
    public static final int TOKEN_IS_NOT_EXITS = 109;
    public static final int TOKEN_IS_WRONG = 110;
    public static final int USER_IS_STOP = 111;
    public static final int NOT_LOGIN = 112;
    public static final int CODE_IS_WRONG = 113;
    public static final int RANDOM_IS_TOOFAST = 114;
    public static final int UNBIND_THIRD_WARING = 115;
    public static final int FAILTURE = 116;
    public static final int EMAIL_IS_BIND = 117;
    public static final int MOBILE_IS_BIND = 118;
    public static final int HAS_SENSITIVE = 119;
    public static final int OLD_PASS_IS_WRONG = 120;
    public static final int THE_NEW_THIRD = 121;
    public static final int THE_THIRD_IS_EXITS = 122;
    public static final int ADD_FOLLOWER_FAILTURE = 123;
    public static final int NOT_REPEAT_ACTION = 124;
    public static final int UPLOAD_ERROR = 126;
    public static final int UPLOAD_TYOPE_ERROR = 127;
    public static final int COLLECT_CODE = 128;
    public static final int TAG_EXITS = 130;
    public static final int NICKNAME_IS_WRONG = 131;
    public static final int USER_FORBIT = 132;
    public static final int DETAIL_NOT_READ = 133;
    public static final int DETAIL_NOT_TEXT = 134;
    public static final int CAN_NOT_LOGIN = 135;
    public static final int USER_NOT_PASSED = 136;

    public static enum Status {

        SUCCESS("OK", HttpStatusEnum.SUCCESS),
        INVLID_PARAMTERS("参数不正确", HttpStatusEnum.INVLID_PARAMTERS),
        USER_NOT_FOUND("用户不存在", HttpStatusEnum.USER_NOT_FOUND),
        Authentication_Failure("验证失败", HttpStatusEnum.Authentication_Failure),
        TOKEN_EXPIRED("token 已经过期", HttpStatusEnum.TOKEN_EXPIRED),
        ERROR("系统异常...请稍后再试", HttpStatusEnum.ERROR),
        PASSWORD_IS_WRONG("密码错误", HttpStatusEnum.PASSWORD_IS_WRONG),
        USERNAME_IS_LIVED("用户名已经存在", HttpStatusEnum.USERNAME_IS_LIVED),
        NICKNAME_IS_LIVED("昵称已经存在", HttpStatusEnum.NICKNAME_IS_LIVED),
        TOKEN_IS_NOT_EXITS("token 不存在", HttpStatusEnum.TOKEN_IS_NOT_EXITS),
        TOKEN_IS_WRONG("token 错误", HttpStatusEnum.TOKEN_IS_WRONG),
        USER_IS_STOP("用户已经被封停", HttpStatusEnum.USER_IS_STOP),
        NOT_LOGIN("请先登录", HttpStatusEnum.NOT_LOGIN),
        EMAIL_IS_BIND("邮箱已经被绑定", HttpStatusEnum.EMAIL_IS_BIND),
        MOBILE_IS_BIND("手机已经被绑定", HttpStatusEnum.MOBILE_IS_BIND),
        HAS_SENSITIVE("该内容含有敏感词汇", HttpStatusEnum.HAS_SENSITIVE),
        FAILTURE("验证码发送失败", HttpStatusEnum.FAILTURE),
        OLD_PASS_IS_WRONG("原密码不正确", HttpStatusEnum.OLD_PASS_IS_WRONG),
        THE_NEW_THIRD("您的账号是新的第三方账号", HttpStatusEnum.THE_NEW_THIRD),
        THE_THIRD_IS_EXITS("第三方账号已经存在", HttpStatusEnum.THE_THIRD_IS_EXITS),
        ADD_FOLLOWER_FAILTURE("操作失败", HttpStatusEnum.ADD_FOLLOWER_FAILTURE),
        NOT_REPEAT_ACTION("请勿重复操作", HttpStatusEnum.NOT_REPEAT_ACTION),
        RANDOM_IS_TOOFAST("验证码请求太频繁", HttpStatusEnum.RANDOM_IS_TOOFAST),
        CODE_IS_WRONG("验证码错误", HttpStatusEnum.CODE_IS_WRONG),
        VALI_IS_WRONG("sign验证失败", HttpStatusEnum.VALI_IS_WRONG),
        UPLOAD_ERROR("图片上传失败", HttpStatusEnum.UPLOAD_ERROR),
        COLLECT_CODE("已经执行过此操作", HttpStatusEnum.COLLECT_CODE),
        TAG_EXITS("标签已经存在", HttpStatusEnum.TAG_EXITS),
        NICKNAME_IS_WRONG("昵称格式不正确,只能包含英文、汉字、数字和下划线", HttpStatusEnum.NICKNAME_IS_WRONG),
        UPLOAD_TYOPE_ERROR("上传图片暂不支持gif格式", HttpStatusEnum.UPLOAD_TYOPE_ERROR),
        USER_FORBIT("您已经被禁言,可以到个人中心中去申诉", HttpStatusEnum.USER_FORBIT),
        UNBIND_THIRD_WARING("无法解绑,账号至少保留一种绑定方式", HttpStatusEnum.UNBIND_THIRD_WARING),
        CAN_NOT_LOGIN("您的账号已经被封停", HttpStatusEnum.CAN_NOT_LOGIN),
        DETAIL_NOT_READ("这条主题已经消失在黑洞边际，再也找不回来了……", HttpStatusEnum.DETAIL_NOT_READ),
        DETAIL_NOT_TEXT("请输入内容", HttpStatusEnum.DETAIL_NOT_TEXT),
        USER_NOT_PASSED("用户已经禁言", HttpStatusEnum.USER_NOT_PASSED);

        private String name;
        private int index;

        // 构造方法
        private Status(String name, int index) {
            this.name = name;
            this.index = index;
        }

        // 普通方法
        public static String getName(int index) {
            for (Status c : Status.values()) {
                if (c.index == index) {
                    return c.name;
                }
            }
            return null;
        }
    }


}
